<template>
	<view class="content">
		<z-paging ref="paging">
			<template #top>
				<div style="padding: 10px 12px;background: #FFF8EA;color: #FC8800;" v-if="form1.checkStatus==0">
					审核中
				</div>
				<div style="padding: 10px 12px;background: #FFECE8;color: #F53F3F;" v-if="form1.checkStatus==2">
					审核失败
				</div>
			</template>
			<div class="rzTitle">油站信息</div>
			<div class="zrzBox-w">
				<div class="zbox-formItem">
					<div class="formItem-lef">油站名称</div>
					<div>{{form1.stationName}}</div>
				</div>
				<div class="zbox-formItem">
					<div class="formItem-lef">油站类型</div>
					<div v-if="form1.stationType==0">混合</div>
					<div v-if="form1.stationType==1">油</div>
					<div v-if="form1.stationType==0">气</div>
				</div>
				<div class="zbox-formItem">
					<div class="formItem-lef">营业时间</div>
					<div>{{form1.openTime}}</div>
				</div>
				<div class="zbox-formItem">
					<div class="formItem-lef">所在地区</div>
					<div>{{form1.province}}{{form1.city}}{{form1.district}}</div>
				</div>
				<div class="zbox-formItem">
					<div class="formItem-lef">详细地址</div>
					<div>{{form1.address}}</div>
				</div>
				<div class="zbox-formItem">
					<div class="formItem-lef">业务联系人</div>
					<div>{{form1.leaderName}}</div>
				</div>
				<div class="zbox-formItem">
					<div class="formItem-lef">联系电话</div>
					<div>{{form1.leaderPhone}}</div>
				</div>
			</div>


			<div class="rzTitle">企业信息</div>
			<div class="zrzBox-w">
				<div class="zbox-formItem">
					<div>
						<div style="margin-bottom: 12px;">营业执照</div>
						<image class="rzImg" :src="form2.bpnImg" @click="showImg(form2.bpnImg)"></image>

						<div class="zjDes">上传营业执照</div>
					</div>
				</div>
				<div class="zbox-formItem">
					<div class="formItem-lef">公司名称</div>
					<div>{{form2.name}}</div>
				</div>
				<div class="zbox-formItem">
					<div class="formItem-lef">统一社会信用代码</div>
					<div>{{form2.bpnCode}}</div>
				</div>
				<div class="zbox-formItem">
					<div class="formItem-lef">注册地</div>
					<div>{{form2.province}}{{form2.city}}{{form2.area}}</div>
				</div>
				<div class="zbox-formItem">
					<div class="formItem-lef">详细地址</div>
					<div>{{form2.address}}</div>
				</div>
			</div>

			<div class="rzTitle">法人信息</div>
			<div class="zrzBox-w">
				<div class="zbox-formItem">
					<div style="margin-right: auto;">
						<image class="rzImg" :src="form2.idCardFront" @click="showImg(form2.idCardFront)"></image>

						<div class="zjDes">人像面</div>
					</div>
					<div>
						<image class="rzImg" :src="form2.idCareBack" @click="showImg(form2.idCareBack)"></image>

						<div class="zjDes">国徽面</div>
					</div>
				</div>
				<div class="zbox-formItem">
					<div class="formItem-lef">法人姓名</div>
					<div>{{form2.leader}}</div>
				</div>
				<div class="zbox-formItem">
					<div class="formItem-lef">法人身份证号</div>
					<div>{{form2.idCardCode}}</div>
				</div>
			</div>

			<div class="rzTitle">资质信息</div>
			<div class="zrzBox-w">
				<div class="zbox-formItem">
					<div>
						<div style="margin-bottom: 12px;">危险化学品经营许可证</div>
						<image class="rzImg" :src="form2.permitImg" @click="showImg(form2.permitImg)"></image>

						<div class="zjDes">上传经营许可证</div>
					</div>
				</div>
				<div class="zbox-formItem">
					<div class="formItem-lef">证书编号</div>
					<div>{{form2.permitCode}}</div>
				</div>
				<div class="zbox-formItem">
					<div class="formItem-lef">有效期限</div>
					<div>{{form2.permitRangeStart}}-{{form2.permitRangeEnd}}</div>
				</div>
			</div>



			<div style="height: 100px;"></div>

			<div class="fix-bom" v-if="form1.checkStatus==2">
				<div style="text-align: center;width: 80px;" @click="callKefu">
					<image class="iconkf" src="/static/images/icon_kf.png"></image>
					<div class="txtkf">客服电话</div>
				</div>
				<div class="btn-pay btnT3" @click="goPage('/pages/my/company/renzheng?status=100&stationId=' + eId)">
					重新提交申请</div>
				<div class="btn-pay btnT3" @click="logOut">
					退出登录</div>
			</div>
			<div class="fix-bom" v-if="form1.checkStatus==0">
				<div class="btn-pay btnT3" style="width: 50%;background: #fff;" @click="callKefu">
					<image class="iconkf" src="/static/images/icon_kf.png"></image>
					<div style="margin-left: 6px;color: #4475EE;">客服电话</div>
				</div>
				<div class="btn-pay btnT3" style="width: 50%;" @click="logOut">
					退出登录</div>
			</div>

		</z-paging>
	</view>
</template>

<script>
	import {
		detailsStation
	} from '@/request/api.js'
	import {
		removeToken
	} from '@/utils/auth'
	export default {
		components: {

		},
		data() {
			return {
				val: '',
				eId: '',
				form1: {},
				form2: {},
			}
		},
		mounted() {

		},
		onLoad(e) {
			this.eId = e.id
			this.getDetails()
		},

		onShow() {},
		methods: {
			getDetails() {
				detailsStation(this.eId).then(res => {
					console.log('111', res) //checkStatus 0待审核 1成功 2失败
					this.form1 = res.data
					this.form2 = res.data.oilCompany
				})
			},
			callKefu() {
				const phone = getApp().globalData.kefuPhone
				uni.makePhoneCall({
					phoneNumber: phone,
					success() {

					}
				})
			},
			showImg(url) {
				uni.previewImage({
					current: url,
					urls: [url],
					indicator: 'none',
					loop: false
				});
			},
			goPage(row) {
				uni.navigateTo({
					url: row
				})
			},
			cancel() {
				this.visible = false
			},

			logOut() {
				removeToken()
				uni.reLaunch({
					url: '/pages/login/login'
				})
			},
		}
	}
</script>

<style scoped>
	.btnT3 {
		width: 40%;
		background: #4475EE;
		border: 1px solid #4475EE;
	}
</style>
<style>
	.zrzBox-w .uni-easyinput {
		text-align: right;
	}
</style>